﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace Secams.utils
{
    class ControlUtils
    {
        public static bool checkTextBox(ref TextBox inputCtrl, ref Label label)
        {
            if (inputCtrl.Text.Trim().Length == 0)
            {
                label.ForeColor = Color.Red;
                inputCtrl.Focus();
                return false;
            }
            label.ForeColor = Color.Black;
            return true;
        }

        public static bool checkComboBox(ref ComboBox inputCtrl, ref Label label)
        {
            if (inputCtrl.SelectedIndex < 0)
            {
                label.ForeColor = Color.Red;
                inputCtrl.Focus();
                return false;
            }
            label.ForeColor = Color.Black;
            return true;
        }
    }
}
